<div id="menu">
    <?
    $get_modules = "SELECT * FROM `" . $DBprefix . "modules` ORDER BY `mod_id` ASC";
    $exexute_get_modules = mysql_query($get_modules);

    while ($module = mysql_fetch_array($exexute_get_modules)) {

        $mod_id = $module["mod_id"];
        $mod_name = $module["mod_name"];
        $mod_location = $module["mod_location"];

        if (file_exists("inc/modules/$mod_location")) {
            if ($mod_id == $modid) {
                echo "<a href='in.php?show=mod&modid=$mod_id' class='menu menuSelected'>$mod_name</a><div class='sep'></div>";
            } else {
                echo "<a href='in.php?show=mod&modid=$mod_id' class='menu'>$mod_name</a><div class='sep'></div>";
            }
        } else {
            echo "<a href='in.php?show=config&view=modules&e=12' class='menu menu'>$mod_name</a><div class='sep'></div>";
        }
    }
    ?>
</div>	